﻿using System;
using UnityEngine;

namespace HK.Core.GUIEx.Protocol.Attribute
{
    /// <summary>
    /// GUI操作选项
    /// </summary>
    [Flags]
    public enum GUIOperateOptions
    {
        /// <summary>
        /// 无
        /// </summary>
        None = 0x00000000,
        
        /// <summary>
        /// 绘制背景
        /// </summary>
        DrawBg = 0x00000001,
		
        /// <summary>
        /// 只读
        /// </summary>
        ReadOnly = 0x00000002,
		
        /// <summary>
        /// 可展开
        /// </summary>
        Expandable = 0x00000004,
        
        /// <summary>
        /// 可选中
        /// </summary>
        Selectable = 0x00000008,
		
        /// <summary>
        /// 可点击
        /// </summary>
        Clickable = 0x00000010,
		
        /// <summary>
        /// 可拖拽
        /// </summary>
        Draggable = 0x00000020,
        
        /// <summary>
        /// 多行
        /// </summary>
        MultiLine = 0x00000040,
        
        /// <summary>
        /// 成员资产
        /// <para>* true : 成员为资产对象</para>
        /// </summary>
        MemberAsset = 0x00000080,
        
        /// <summary>
        /// 成员无标题
        /// </summary>
        MemberNoCaption = 0x00000100,
        
        /// <summary>
        /// 成员可拖拽
        /// </summary>
        MemberDraggable = 0x00000200,
        
        /// <summary>
        /// 成员唯一
        /// </summary>
        MemberDistinct = 0x00000400,
		
        /// <summary>
        /// 可检索
        /// </summary>
        Searchable = 0x00000800,
		
        /// <summary>
        /// 可排序
        /// </summary>
        Sortable = 0x00001000,
        
        /// <summary>
        /// 可分页
        /// </summary>
        Pageable = 0x00002000,
        
        /// <summary>
        /// 可编辑
        /// </summary>
        Editable = 0x00004000,
		
        /// <summary>
        /// 可追加
        /// </summary>
        Addable = 0x00008000,
		
        /// <summary>
        /// 可移除
        /// </summary>
        Removable = 0x00010000,
        
        /// <summary>
        /// 最小化
        /// </summary>
        Minimize = 0x00020000,
        
        /// <summary>
        /// 最大化
        /// </summary>
        Maximize = 0x00040000,
        
        /// <summary>
        /// 可枷锁
        /// </summary>
        Lockable = 0x00080000,
        
        /// <summary>
        /// 可导入
        /// </summary>
        Importable = 0x00100000,
        
        /// <summary>
        /// 可导出
        /// </summary>
        Exportable = 0x00200000,
        
        /// <summary>
        /// 可导出
        /// </summary>
        Clearable = 0x00400000,
            
        /// <summary>
        /// 刷新
        /// </summary>
        Refresh = 0x08000000,
            
        /// <summary>
        /// 缩进重绘
        /// </summary>
        IntentRepaint = 0x10000000,
        
        /// <summary>
        /// 按Property绘制
        /// </summary>
        DrawProperty = 0x20000000,
        
        /// <summary>
        /// 可帮助的
        /// <para>* 窗体右上角，工具栏处有帮助按钮</para>
        /// </summary>
        Helpful = 0x40000000,
		
        /// <summary>
        /// 可点击背景
        /// </summary>
        ClickableBackground = DrawBg | Clickable,
            
        /// <summary>
        /// 序列化资产版本
        /// </summary>
        SAssetVersion = ReadOnly | Expandable | Editable,
            
        /// <summary>
        /// 可展开+可编辑
        /// </summary>
        ExpandableEdit = Expandable | Editable,
        
        /// <summary>
        /// Group视图
        /// </summary>
        GroupView = Expandable | Minimize | Maximize | Editable | DrawProperty,
        
        /// <summary>
        /// 列表视图
        /// </summary>
        ListView = GroupView | Addable | Removable | MemberDraggable,
        
        /// <summary>
        /// 列表Element背景
        /// </summary>
        ListElementBg = DrawBg | Clickable,
        
        /// <summary>
        /// I/O对象背景
        /// <para>* 文件+文件夹</para>
        /// </summary>
        IoTargetBg = ListElementBg,
        
        /// <summary>
        /// 序列化资产Body
        /// </summary>
        SBody = GroupView,
        
        /// <summary>
        /// MinMax Filed
        /// </summary>
        MinMaxField = Editable | DrawProperty,
        
        /// <summary>
        /// 一般字段
        /// </summary>
        GenericField = Selectable | Editable | DrawProperty,
        
        /// <summary>
        /// 一般字段
        /// <para>* 包含背景</para>
        /// </summary>
        BgGenericField = DrawBg | Editable | DrawProperty,
        
        /// <summary>
        /// 一般字段 - 只读
        /// </summary>
        ReadOnlyGenericField = ReadOnly | Selectable | DrawProperty,
        
        /// <summary>
        /// Foldout
        /// </summary>
        FoldoutNoBg = Expandable,
        
        /// <summary>
        /// 可拖拽背景
        /// </summary>
        DraggableBg = DrawBg | Draggable | Clickable,
        
        /// <summary>
        /// Foldout
        /// </summary>
        Foldout = FoldoutNoBg | DrawBg,
        
        /// <summary>
        /// 默认Label
        /// </summary>
        DefaultLabel = Selectable,
        
        /// <summary>
        /// 日期
        /// </summary>
        DateTime = ReadOnly,
            
        /// <summary>
        /// 路径浏览(文件+文件夹)
        /// </summary>
        PathBrowse = Clickable | Draggable,
        
        /// <summary>
        /// 校验码
        /// </summary>
        CheckCode = ReadOnly | Refresh,
        
        /// <summary>
        /// 可序列化资产列表
        /// </summary>
        SAsset = Importable | Exportable | Clearable,
        
        /// <summary>
        /// 默认ListView
        /// </summary>
        DefaultListView = SBody | Searchable | Sortable | Removable,
        
        /// <summary>
        /// 默认分页
        /// </summary>
        DefaultPagination = DefaultListView | Pageable,
        
        /// <summary>
        /// 可拖拽的分页
        /// </summary>
        DraggablePagination = DefaultListView | Addable | Pageable | Draggable,
        
        /// <summary>
        /// 预制体分页列表
        /// </summary>
        PrefabsPagination = DraggablePagination | MemberAsset | MemberDraggable | MemberDistinct,
        
        /// <summary>
        /// 预制体拆分结果分页列表
        /// </summary>
        PrefabsSplitResultPagination = SBody | Pageable | Searchable | Sortable | MemberAsset | MemberDistinct | ReadOnly,
        
        /// <summary>
        /// I/O 对象白名单
        /// <para>* 文件 + 文件夹</para>
        /// </summary>
        IoWhiteList = DefaultListView | Pageable | Draggable,
        
        /// <summary>
        /// 服务器列表
        /// </summary>
        ServersView = DefaultPagination | Addable,
        
        /// <summary>
        /// 白名单 : 字符串
        /// </summary>
        StrWhiteList = GroupView | Pageable | Addable | Removable | MemberNoCaption,
        
        /// <summary>
        /// 宏编辑窗体
        /// </summary>
        DefinesWindow = Expandable | Sortable | Addable | Removable | Editable | Searchable | Importable | Exportable | Clearable | Helpful,
        
        /// <summary>
        /// 加载监视窗体
        /// </summary>
        LoadWatchWindow = Expandable | Sortable | Searchable | Helpful,
        
        /// <summary>
        /// 下载验证窗体
        /// </summary>
        DownloadVerifyWindow = Expandable | Sortable | Editable | Searchable | Importable | Exportable | Helpful,
            
        /// <summary>
        /// 白名单窗体
        /// </summary>
        WhiteListWindow = Expandable | Draggable | Sortable | Searchable | Addable | Removable | Helpful,
        
        /// <summary>
        /// 字符串 - 默认
        /// </summary>
        DefaultStr = DrawProperty | Editable
    }
    
    /// <summary>
    /// 接口 : Attribute - GUI面板基础属性
    /// </summary>
    public interface IGUIAttribute
    {

#region Options

		/// <summary>
		/// 选项
		/// </summary>
		int Options { get; }

		/// <summary>
		/// 绘制背景
		/// </summary>
		bool DrawBg { get; }

		/// <summary>
		/// 只读
		/// </summary>
		bool ReadOnly { get; }

		/// <summary>
		/// 可展开
		/// </summary>
		bool Expandable { get; }        
		
		/// <summary>
		/// 最小化
		/// </summary>
		bool Minimize { get; }
		
		/// <summary>
		/// 最大化
		/// </summary>
		bool Maximize { get; }
        
		/// <summary>
		/// 可追加
		/// </summary>
		bool Addable { get; }
		
		/// <summary>
		/// 可移除
		/// </summary>
		bool Removable { get; }
        
		/// <summary>
		/// 可枷锁
		/// </summary>
		bool Lockable { get; }

		/// <summary>
		/// 可编辑
		/// </summary>
		bool Editable { get; }
        
		/// <summary>
		/// 可拖拽
		/// </summary>
		bool Draggable { get; }
        
		/// <summary>
		/// 多行
		/// </summary>
		bool MultiLine { get; }
		
		/// <summary>
		/// 可点击
		/// </summary>
		bool Clickable { get; }
        
		/// <summary>
		/// 成员资产
		/// <para>* true : 成员为资产对象</para>
		/// </summary>
		bool MemberAsset { get; }
        
		/// <summary>
		/// 成员无标题
		/// </summary>
		bool MemberNoCaption { get; }
		
		/// <summary>
		/// 成员可拖拽
		/// </summary>
		bool MemberDraggable { get; }
        
		/// <summary>
		/// 成员唯一
		/// </summary>
		bool MemberDistinct { get; }
        
		/// <summary>
		/// 可检索
		/// </summary>
		bool Searchable { get; }
        
		/// <summary>
		/// 按Property绘制
		/// </summary>
		bool DrawProperty { get; }
        
		/// <summary>
		/// 是否从Unity调用绘制标志位
		/// </summary>
		bool DrawFromUnity { get; }

#endregion

#region Caption
        
		/// <summary>
		/// 标题
		/// </summary>
		string Caption { get; }
		        
		/// <summary>
		/// Tips
		/// <para>* 鼠标悬停显示Tips</para>
		/// </summary>
		string Tips { get; }
        
		/// <summary>
		/// Icon
		/// </summary>
		string Icon { get; }
		        
		/// <summary>
		/// 背景色
		/// </summary>
		Color BgColor { get; }

#endregion

    }
}
